/** win10
 UTC-12:00
 UTC-11:00
 UTC-10:00
 UTC-09:30
 UTC-09:00
 UTC-08:00
 UTC-07:00
 UTC-06:00
 UTC-05:00
 UTC-04:00
 UTC-03:30
 UTC-03:00
 UTC-02:00
 UTC-01:00
 UTC
 UTC+00:00
 UTC+01:00
 UTC+02:00
 UTC+03:00
 UTC+04:00
 UTC+04:30
 UTC+05:00
 UTC+05:30
 UTC+06:00
 UTC+06:30
 UTC+07:00
 UTC+08:00
 UTC+08:45
 UTC+09:00
 UTC+09:30
 UTC+10:00
 UTC+10:30
 UTC+11:00
 UTC+12:00  协调世界时+12
 UTC+12:45  查塔姆群岛
 UTC+13:00  协调世界时+13
 UTC+14:00  圣诞岛
 */
package com.k.kc.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class TimeZoneUtil {
    private final static String PATTERN_SSZ = "yyyy-MM-dd'T'HH:mm:ss'Z'";
    private final static String PATTERN_SS = "yyyy-MM-dd HH:mm:ss";


    /**
     * @param date date 时间点 不包含时区
     * @param tz   显示成哪个时区
     * @return string
     */
    private static String dateToStr(Date date, TimeZone tz) {
        SimpleDateFormat format = new SimpleDateFormat(PATTERN_SS);
        if (tz != null) {
            format.setTimeZone(tz);
        }
        return format.format(date);
    }

    /**
     * @param dateStr 时间字符串
     * @param tz      时间字符串时区
     * @param pattern pattern
     * @return Date
     * @throws ParseException
     */
    private static Date strToDate(String dateStr, TimeZone tz, String pattern) throws ParseException {
        SimpleDateFormat format = new SimpleDateFormat(pattern);
        format.setTimeZone(tz);
        return format.parse(dateStr);
    }
    private void windows10timezone(){

    }
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println(TimeZone.getDefault());
        System.out.println(date);
        System.out.println(date.getTime());
        TimeZone timeZoneGMT = TimeZone.getTimeZone("GMT");
        TimeZone.setDefault(timeZoneGMT);
        Date date1 = new Date();
        System.out.println(TimeZone.getDefault());
        System.out.println(date1);
        System.out.println(date1.getTime());
    }
}
